<h3>Rooms</h3>

<table>
  <tr>
    <th>Location</th>
    <th>Beds</th>
    <th>Updated</th>
  </tr>

<% for room in @rooms %>
  <tr>
    <td><%=h room.location %></td>
    
    <td>
      <%= render :partial => 'room_occupancy', :locals => {:room => room} %>
    </td>
    
    <td><%=dt room.updated_at %></td>
    
    <td><%= link_to 'Show', agency_site_room_path(params[:agency_id], params[:site_id], room) %></td>
    <td><%= link_to 'Edit', edit_agency_site_room_path(params[:agency_id], params[:site_id], room) %></td>
    <% if is_admin? -%>
      <td><%= link_to 'Delete', agency_site_room_path(params[:agency_id], params[:site_id], room), :confirm => 'Are you sure?', :method => :delete, :class => 'delete' %></td>
    <% end -%>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'Add a new Room', new_agency_site_room_path(params[:agency_id], params[:site_id]) %>
